#ifndef SEARCHSERVER_H 
#define SEARCHSERVER_H

#include "inicpp.hpp"
#include "splitTool.h"
#include "pageLibPrecessor.h"

#include <workflow/WFFacilities.h>
#include <wfrest/HttpServer.h>

class SearchServer
{
public:
    SearchServer(int cnt, PageLibPrecessor* _precessor);
    ~SearchServer() {}
    void start(unsigned short port);
    void loadModules();
private:
    //模块化的思维方式写代码
    void loadStaticResourceModule();
    void loadSearchModule();
    void recommendWord(string searchContent, vector<string> &results);

private:
    WFFacilities::WaitGroup _waitGroup;
    wfrest::HttpServer _httpserver;

    PageLibPrecessor* _precessor;//用来分词和计算权重w'
};

#endif

